package com.mspbots.core.ticketai.mapper;

import com.mspbots.core.DefaultBaseMapper;
import com.mspbots.core.ticketai.model.Ticket;
import com.mspbots.core.ticketai.model.TicketOnly;
import com.mspbots.core.ticketai.model.TicketStatistic;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * com.mspbots.core.ticketai.TicketMapper
 *
 * @author Alex bob(https://github.com/vnobo)
 * @date Created by 2019/8/8
 */
@Mapper
public interface TicketMapper extends DefaultBaseMapper<Ticket> {

    List<TicketStatistic> countEveryday(@Param("tenantId") Long tenantId);

    List<TicketOnly> getTicketsByTenantIdNew(Ticket ticket);

    Long selectMinId(Long tenantId);

    Long selectMaxId(Long tenantId);

    Long deleteByMinMaxId(Long tenantId, Long ticketMinId, Long ticketMaxId);

    Ticket findNextTicketRate(Ticket queryParams);
}
